package edu.pxxy.yzj.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;


public class MyDBOpenHelper extends SQLiteOpenHelper {
    private static final String DB_NAME="yzj.db";
    private static final Integer DB_VERSION=1;
    private String createSql="create table if not exists food(_id integer primary key autoincrement,foodname text,foodprice real,count integer)";
    public MyDBOpenHelper(Context context){
        super(context,DB_NAME,null,DB_VERSION);
    }
    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL(createSql);
        System.out.println("created");
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
        Log.d("used","updated");
    }
}
